//
// Created by wxd on 2025/7/27.
//

#pragma once

#include "BaseCamera.h"

struct OrthoBox {
    float left;
    float right;
    float top;
    float bottom;
    float zNear;
    float zFar;

    OrthoBox() : left(0.0f), right(0.0f), top(0.0f), bottom(0.0f), zNear(0.0f), zFar(0.0f) {}

    OrthoBox(const OrthoBox&) = default;

    OrthoBox& operator=(const OrthoBox&) = default;

    OrthoBox(const float l, const float r,
             const float t, const float b,
             const float n, const float f) : left(l), right(r), top(t), bottom(b), zNear(n), zFar(f) {}
};

class OrthogonalCamera : public BaseCamera {
public:
    OrthogonalCamera();
    OrthogonalCamera(float l, float r, float t, float b, float n, float f);
    explicit OrthogonalCamera(const OrthoBox& orthoBox) : m_OrthoBox(orthoBox) {}
    OrthogonalCamera(const OrthoBox& orthoBox, glm::vec3 pos, glm::vec3 up, glm::vec3 right) : BaseCamera(pos, up, right), m_OrthoBox(orthoBox) {};

    ~OrthogonalCamera() override;

    glm::mat4 getProjectMatrix() override;

private:
    OrthoBox m_OrthoBox;
};